<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Index</title>
<%@include file="/header.html"%>

</head>
<%
	String side_bar_page = basePath + "side_bar.jsp";
%>
<body>
	<div>
		<jsp:include page="/side_bar.jsp" flush="true" />
		<jsp:include page="/top_bar.jsp" flush="true" />

	</div>

	<section class="content" style="width:87%; float:right; margin:15px;">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<div class="box-header">
					<h3 class="box-title">资产调出</h3>
				</div>
				<!-- /.box-header -->
				<div class="box-body">
					<div id="example2_wrapper"
						class="dataTables_wrapper form-inline dt-bootstrap">
						<div class="row">
							<div class="col-sm-6"></div>
							<div class="col-sm-6"></div>
						</div>
						<div class="row">
							<div class="col-sm-12">


								<form action="queryAllocationout.action" method="post">
									<table align="center">
										<tr>
											<td
												style="vertical-align: middle; front-size:14px; font-weight:bold;">资产名称
												<input type="text" class="form-control"
												style="width: 300px;height: 30px;font-size: 16px"
												name="queryText" value="${searchText }" /> <input
												class="btn btn-primary btn-sm" type="submit" value="查询"
												style="width: 100px;height: 30px;font-size: 16px" /></td>
										</tr>
									</table>
								</form>
								</br>
								<table table id="t_asset"
									class="table table-bordered table-hover dataTable" role="grid"
									aria-describedby="example2_info" align="center" border="1"
									cellpadding="0" cellspacing="0" bordercolor="#3366cc">
									<thead>
										<tr role="row" bgcolor="#3c8dbc" height="20px">
											<th class="text-center" width="60">序号</th>
											<!--        <th width="100">资产类别ID</th>   -->
											<th class="text-center" width="100">资产名称</th>
											<th class="text-center" width="100">使用人</th>
											<!--     <th width="110">使用人部门ID</th>  -->
											<th class="text-center" width="100">使用人部门</th>
											<!--  <th width="110">财务入账人ID</th>  -->
											<!--      <th width="110">采购单明细ID</th>  -->
											<!--     <th width="130">上级资产类别ID</th>  -->
											<!--       <th width="100">卡片编号</th>     -->
											<th class="text-center" width="100">在库状态</th>
											<th class="text-center" width="100">使用状态</th>
											<!--  <th width="100">规格型号</th>   -->
											<!-- <th width="100">财务是否入账</th>   -->
											<!--  <th width="70">单位</th>  
             <th width="70">数量</th>   -->
											<th class="text-center" width="100">操作</th>
										</tr>
									</thead>


									<c:forEach var="asset" items="${assets }"  varStatus="status">
										<tr align="center" height="20px">
											<td width="60">${status.index+1}</td>
											<%--   <td width="100">${asset.assetcatalogid}</td>   --%>
											<td width="100">${asset.assetname}</td>
											<td width="100">${asset.user.userid}</td>
											<%--     <td width="110">${asset.userdeptid}</td>   --%>
											<td width="100">${asset.user.dept.deptname}</td>
											<%--   <td width="110">${asset.recordid}</td>   --%>
											<%--    <td width="110">${asset.purchasenotedeitailid}</td>  
                <td width="130">${asset.superiorassetcatalogid}</td>  
                <td width="100">${asset.carnumber}</td>   --%>
											<td width="100"><c:if test="${asset.instockstate==0}">在用</c:if>
												<c:if test="${asset.instockstate==1}">库存</c:if></td>
											<td width="100"><c:if test="${asset.userState==0}">待领用</c:if>
												<c:if test="${asset.userState==1}">正常</c:if> <c:if
													test="${asset.userState==2}">送修</c:if> <c:if
													test="${asset.userState==3}">待报废</c:if> <c:if
													test="${asset.userState==4}">待调入</c:if> <c:if
													test="${asset.userState==5}">报废</c:if></td>


											<%--   <td width="100">${asset.standardnumber}</td>   --%>
											<%--   <td width="70">${asset.unit}</td>  
                <td width="70">${asset.number}</td>   --%>

											<td width="100"><a
												href="detailAsset.action?assetid=${asset.assetid}">资产详情
											</a> <a href="queryAllocation.action?assetid=${asset.assetid}">调拨记录
											</a> <c:if test="${0==asset.instockstate&&1==asset.userState}">
													<a
														href="allocationlist.action?assetid=${asset.assetid}&assetuser=${asset.user.userid}">调出
													</a>
												</c:if></td>
										</tr>
									</c:forEach>
								</table>
								<!-- 分页 -->
								<center>
									<div>
										共有 <span id="spanTotalInfor"></span> 条记录 当前第<span
											id="spanPageNum"></span>页 共<span id="spanTotalPage"></span>页
									</div>
									<div>
										<span id="spanFirst">FIRST</span> <span id="spanPre">UP</span>
										<span id="spanInput"
											style="margin: 0px; padding: 0px 0px 4px 0px; height:100%; ">
											第<input id="Text1" type="text" class="TextBox"
											onkeyup="changepage()"
											style="height:20px; text-align: center;width:50px" />页 </span> <span
											id="spanNext">DOWN</span> <span id="spanLast">LAST</span>
									</div>
								</center>
								<div class="modal fade" id="myModal" aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>

											</div>
											<div class="modal-body">在这里添加一些文本</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">关闭</button>
												<button type="button" class="btn btn-primary">提交更改</button>
											</div>
										</div>
										<!-- /.modal-content -->
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<script type="text/javascript">
		var theTable = document.getElementById("t_asset");
		var txtValue = document.getElementById("Text1").value;
		function changepage() {
			var txtValue2 = document.getElementById("Text1").value;
			if (txtValue != txtValue2) {
				if (txtValue2 > pageCount()) {

				} else if (txtValue2 <= 0) {

				} else if (txtValue2 == 1) {
					first();
				} else if (txtValue2 == pageCount()) {
					last();
				} else {
					hideTable();
					page = txtValue2;
					pageNum2.value = page;

					currentRow = pageSize * page;
					maxRow = currentRow - pageSize;
					if (currentRow > numberRowsInTable)
						currentRow = numberRowsInTable;
					for ( var i = maxRow; i < currentRow; i++) {
						theTable.rows[i].style.display = '';
					}
					if (maxRow == 0) {
						preText();
						firstText();
					}
					showPage();
					nextLink();
					lastLink();
					preLink();
					firstLink();
				}

				txtValue = txtValue2;
			}
		}
	</script>
	<script type="text/javascript" src="./js/Pagging.js"></script>
	<!-- 分页 -->
	</div>
	<%@include file="../footer.html"%>
</body>
</html>
